package cc.io24.knewcafe.boss.controller;

import cc.io24.knewcafe.boss.domain.SysPermission;
import cc.io24.knewcafe.boss.service.SysPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/SysPermission")
public class SysPermissionController  extends BaseController<SysPermission> {

    @Autowired
    public void setService(SysPermissionService sysPermissionService){
        super.setService(sysPermissionService);
    }

//    @GetMapping(value = "",produces="application/json")
//    public List<SysPermission> getList(@ModelAttribute SysPermission sysPermission,
//                                       @PageableDefault(value = 10, sort = { "permissionName" }, direction = Sort.Direction.DESC)Pageable pageable,
//                                       HttpServletResponse response){
//        Page<SysPermission> page =  sysPermissionService.getList(sysPermission,pageable);
//        response.addHeader("X-Total-Count",page.getTotalElements()+"");
//        response.addHeader("Access-Control-Expose-Headers","X-Total-Count");
//        return page.getContent();
//    }
//
//    @GetMapping(value = "/{id}",produces="application/json")
//    public SysPermission getOne(@PathVariable("id")String id,
//                                   HttpServletResponse response){
//        SysPermission sysPermission =  sysPermissionService.getOne(id);
//        return sysPermission;
//    }
//
//
//    @PostMapping(value = "",produces="application/json")
//    public SysPermission create(@RequestBody SysPermission sysPermission,
//                          HttpServletResponse response){
//        return sysPermissionService.insert(sysPermission);
//    }
//
//    @PutMapping(value = "/{id}",produces="application/json")
//    public SysPermission update(@PathVariable("id")String id,
//                          @RequestBody SysPermission sysPermission,
//                          HttpServletResponse response){
//        sysPermission.setId(id);
//        return sysPermissionService.update(sysPermission);
//    }
//
//    @DeleteMapping(value = "/{id}",produces="application/json")
//    public void delete(@PathVariable("id")String id,
//                          HttpServletResponse response){
//        sysPermissionService.deleteById(id);
//    }

}
